package Entity;

import Controllers.GlobalData;
import Controllers.GenericToolsForController.WorkerRolls;

public class Worker extends User 
{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private WorkerRolls role;
	public WorkerRolls getRole() {
		return role;
	}
	/**
	 * setter role
	 * @param Role
	 */
	public void setRole(WorkerRolls Role) {
		this.role = Role;
	}
	/**
	 * getter id
	 * @return
	 */
	public int getId() {
		return workerId;
	}
	/**
	 * setter id
	 * @param id
	 */
	public void setId(int id) {
		this.workerId = id;
	}


	private int workerId;
	/**
	 * full constructor 
	 * @param userId
	 * @param workerId
	 * @param firstName
	 * @param lastName
	 * @param email
	 * @param phone
	 * @param username
	 * @param roll
	 */
	public Worker(int userId,int workerId, String firstName, String lastName, String email,
			String phone, String username,String roll) {
		super(userId, firstName, lastName, email, phone, username,"Worker");
		this.workerId = workerId;
		this.role =  WorkerRolls.fromString(roll);
		// TODO Auto-generated constructor stub
	}
	/**
	 *  light constructor
	 * @param workerid
	 * @param roll
	 */
	public Worker(int workerid , String roll){
		this.role =  WorkerRolls.fromString(roll);
		this.workerId = workerid;
	}
	/**
	 * 
	 * @param workerid
	 * @param role
	 * @param user
	 */
	/**
	 * constructor form user
	 * @param workerid
	 * @param role
	 * @param user
	 */
	public Worker(int workerid , String role, User user)
	{
		super(user);
		this.role =  WorkerRolls.fromString(role);
		this.workerId = workerid;
		
	}
	
	/**
	 * this method is used to make columns to the table
	 * @return
	 */
	public String[] dataToStringArray() 
	{
	      return new String[]{workerId+"",firstName,lastName,username,email,phone};      
	}
	/**
	 * this method is used to make columns to the table
	 * @return
	 */
	public String[] indexStringArray() 
	{
	      return new String[]{"Worker Id","first Name","last Name", "User Name","Email","Phone"};      
	}


	/**
	 * add the specific  worker to database 
	 */
	public void addWorkerToDb() 
	{
		String[] data = new String[]{firstName,lastName,email,phone};
		Message ansMessage = new Message(1007, GlobalData.MESSAGE_ID(), data);
		

	}
	
	

	public void askForTimeExtension(String reason)
	{
		
	}
}
